home *** CD-ROM | disk | FTP | other *** search
Text File | 2002-08-01 | 50.7 KB | 1,692 lines |
- #-------------------------------------------------------------------------------
- # newmenu.tcl
- #
- # NOMADS main- and ingame-menus.
- #
- # 06-May-02 floh menuhandler now created in envinit.tcl!
- # 15-May-02 floh FlushAudio in nm_killgame
- #-------------------------------------------------------------------------------
-
- global demoFlag
- global devstation
-
-
- #===============================================================================
- #
- # Utility functions
- #
- #===============================================================================
-
- #-------------------------------------------------------------------------------
- # Play the menu music
- #-------------------------------------------------------------------------------
- proc nm_menumusic {} {
- /world.playsound book:music/danger3.wav
- }
-
- #-------------------------------------------------------------------------------
- # Show main menu
- #-------------------------------------------------------------------------------
- proc nm_mainmenu {} {
- /sys/servers/menuhandler.openmenu "main"
- nm_menumusic
- }
-
- #-------------------------------------------------------------------------------
- # Endgame menu
- #-------------------------------------------------------------------------------
- proc nm_ingame_endgame {} {
-
- # mute and flush audio
- /sys/servers/audio.flushaudio 0 0
-
- if {[/world.ispaused] == "false"} {
- /world.pausegame
- }
-
- /sys/servers/menuhandler.openmenu "ingame_endgame"
- /sys/servers/menuhandler.reset
- }
-
- #-------------------------------------------------------------------------------
- # Credits
- #-------------------------------------------------------------------------------
- proc nm_credits {} {
- /sys/servers/menuhandler.showcredits "/data/if_credits/cred" 0
- }
-
- #-------------------------------------------------------------------------------
- # Singleplayer character selection
- #-------------------------------------------------------------------------------
- proc nm_character_single {} {
- global demoFlag
-
- if {$demoFlag} {
-
- # demo distribution: directly start game with char_john
- set character_proto char_john
- m_newgame
-
- } else {
-
- # Set channels for characters first.
- /sys/servers/channel.setchannel1f will_horiz 0.5
- /sys/servers/channel.setchannel1f will_vert 0.5
-
- # Open character menu
- /sys/servers/menuhandler.openmenu "character_singleplayer"
- }
- }
- #-------------------------------------------------------------------------------
- # Load single player game
- #
- # 04-Jul-02 floh fastposses wurde generell aktiviert, das ist falsch,
- # weil damit der Zustand von Makegame ueberschrieben wurde
- #-------------------------------------------------------------------------------
- proc nm_loadgame_single {name} {
- global home
- if {[file exists $home/save/$name.n] == 1} {
- /world.loadgame home:save/$name.n
-
- # Restart point wiederherstellen
- if {[file exists $home/save/restart_$name.n] == 1} {
- file copy -force $home/save/restart_$name.n $home/save/restartpoint.n
- }
-
- # Continue game if paused (ingame menu)
- if {[/world.ispaused]} {
- /world.contgame
- }
- } else {
- puts "Save slot is empty."
- /sys/servers/menuhandler.cancelmenu
- }
-
- # update the save point savegame
- savepoint
- }
-
- #-------------------------------------------------------------------------------
- # Save current game
- #-------------------------------------------------------------------------------
- proc nm_savegame_single {name} {
- global home
-
- # Save game and take screenshot
- /world.savegame home:save/$name
-
- # Restart point mit abspeichern
- if {[file exists $home/save/restartpoint.n] == 1} {
- file copy -force $home/save/restartpoint.n $home/save/restart_$name.n
- }
-
- /world.refreshdisplay
- /sys/servers/gfx.scaledscreenshot $home/save/$name.bmp 128 128
-
- # Unpause and restore input mapping
- if {[/world.ispaused]} {
- /world.contgame
- }
- }
-
- #-------------------------------------------------------------------------------
- # Load island+character files and show character selection screen (Server)
- #-------------------------------------------------------------------------------
- proc nm_load_character_server {} {
- global home
-
- # Hack: Set channels for characters first.
- /sys/servers/channel.setchannel1f will_horiz 0.5
- /sys/servers/channel.setchannel1f will_vert 0.5
-
- # Open character selection menu
- /sys/servers/menuhandler.openmenu "character_server"
- }
-
- #-------------------------------------------------------------------------------
- # Load island+character files and show character selection screen (Client)
- #-------------------------------------------------------------------------------
- proc nm_load_character_client {} {
- global home
-
- # Hack: Set channels for characters first.
- /sys/servers/channel.setchannel1f will_horiz 0.5
- /sys/servers/channel.setchannel1f will_vert 0.5
-
- # Open character selection menu
- /sys/servers/menuhandler.openmenu "character_client"
- }
-
- #-------------------------------------------------------------------------------
- # Select Character+Island slot for multiplayer session (Server)
- #-------------------------------------------------------------------------------
- proc nm_character_server {slot} {
- global character_proto
-
- # Set choosen character
- set character_proto $slot.n
-
- # Open multiplayer load game panel
- /sys/servers/menuhandler.openmenu "loadgame_multiplayer"
- }
-
- #-------------------------------------------------------------------------------
- # Close ingame menu
- #-------------------------------------------------------------------------------
- proc nm_continue_game {} {
-
- /sys/servers/menuhandler.closemenu
- /sys/servers/menuhandler.reset
-
- # Restore handcontrol if unset (Multiplayer).
- if {[/world.gethandcontrol] == "null"} {
- set carrier [/world.getviewercarrier]
- /world.sethandcontrol $carrier
- }
-
- # Continue game if paused (Singleplayer).
- if {[/world.ispaused] == "true"} {
- /world.contgame
- }
- }
-
- #-------------------------------------------------------------------------------
- # Restart level
- #-------------------------------------------------------------------------------
- proc nm_restartlevel {} {
-
- /sys/servers/menuhandler.closemenu
- /sys/servers/menuhandler.reset
-
- # Continue game if paused (Singleplayer).
- if {[/world.ispaused] == "true"} {
- /world.contgame
- }
-
- restartlevel
- }
-
- #-------------------------------------------------------------------------------
- # Open single player loadgame screen
- #-------------------------------------------------------------------------------
- proc nm_open_loadgame_single {} {
-
- # Open load game panel
- /sys/servers/menuhandler.openmenu "loadgame_singleplayer"
- }
-
- #-------------------------------------------------------------------------------
- # Open single player loadgame screen
- #-------------------------------------------------------------------------------
- proc nm_open_savegame_single {} {
-
- # Open load game panel
- /sys/servers/menuhandler.openmenu "savegame_singleplayer"
- }
-
- #-------------------------------------------------------------------------------
- # Select Character+Island slot for multiplayer session (Client)
- #-------------------------------------------------------------------------------
- proc nm_character_client {slot} {
- global character_proto
-
- # Set choosen character
- set character_proto $slot.n
-
- # Open multiplayer load game panel
- nm_sessionlist_multiplayer
- }
-
-
- #-------------------------------------------------------------------------------
- # Load multiplayer game
- #-------------------------------------------------------------------------------
- proc nm_loadgame_multi {slot} {
- global home
-
- if {[file exists $home/mplevels/$slot.n] == 1} {
-
- # Make filename and load game
- set filename $home/mplevels/$slot
- /world.pausegame
- /world.loadmultiplayergame $filename
-
- # Open multiplayer session
- /world.opensession $slot
-
- # Create character
- m_createcharacter
-
- # Load client side win/loose handling script
- source $home/scripts/client.tcl
-
- # Setup multiplayer collision table (true => Multiplayer).
- setup_colltable true
-
- # Continue game and fade in
- if {[/world.ispaused]} {
- /world.contgame
- }
- fadein
-
- # Load default event handling.
- source $home/book/defaultevents.tcl
-
- # Choose viewer
- /world.setviewer2 "/world/viewers/chaseviewer"
-
- # Show `Waiting for other players' menu
- /sys/servers/menuhandler.openmenu "multiplayer_waithost"
- /sys/servers/menuhandler.reset
-
- } else {
- puts "Warning: Slot does not exist."
- /sys/servers/menuhandler.cancelmenu
- }
- }
-
- #-------------------------------------------------------------------------------
- # Update selected options gui entries from the actual preferences.
- #-------------------------------------------------------------------------------
- proc nm_updateoptions {name} {
- set value [/world.getpref $name]
- for {set i 0} {$i < $value} {incr i} {
- /world/gui/menus/options/entries/$name/submenu.right
- }
- }
-
- #-------------------------------------------------------------------------------
- # Open `Options' menu and initialize submenu items from env variables
- #-------------------------------------------------------------------------------
- proc nm_options {} {
-
- # load current prefs settings
- /world.loadprefs
-
- # Open menu
- /sys/servers/menuhandler.openmenu "options"
-
- # Position sub entries; setting variables must exist!!
-
- # update selected option entries
- nm_updateoptions resolution
- nm_updateoptions details
- nm_updateoptions invertmouse
- nm_updateoptions volume
- nm_updateoptions sensitivity
- }
-
- #-------------------------------------------------------------------------------
- # Continue.
- #-------------------------------------------------------------------------------
- proc nm_contgame {} {
-
- # Load savepoint
- loadsavepoint
-
- # Continue game
- if {[/world.ispaused]} {
- /world.contgame
- }
- }
-
- #-------------------------------------------------------------------------------
- # Nearly quit running game
- #-------------------------------------------------------------------------------
- proc nm_killgame {last} {
- global confirmedMenu
- set confirmedMenu $last
- /sys/servers/menuhandler.openmenu "really_abort"
-
- }
-
- proc nm_goback {} {
- global confirmedMenu
- /sys/servers/menuhandler.openmenu $confirmedMenu
-
- }
-
- #-------------------------------------------------------------------------------
- # Thanks for playing screen, this will be displayed when the
- # the player has successfully finished the last level.
- #-------------------------------------------------------------------------------
- proc nm_thanxforplaying {} {
- # mute and flush audio
- /sys/servers/audio.flushaudio 0 0
-
- # Kill artefacts
- delete_possessicon
- delete_artefacts
- delete_ebar
- delete_helpscreen
-
- # Quit game; delete all world objects
- /world.killgame
-
- if {[/world.ispaused]} {
- /world.contgame
- }
-
- # Load singleplayer collision table (false => Singleplayer)
- setup_colltable false
-
- # Show thanx for playing menu
-
- /sys/servers/menuhandler.reset
- /sys/servers/menuhandler.hideallbars
- global demoFlag
- if {$demoFlag} {
- /sys/servers/menuhandler.openmenu "thxforplaying"
- } else {
- nm_credits
- }
-
- }
-
- #-------------------------------------------------------------------------------
- # Really quit running game
- #-------------------------------------------------------------------------------
- proc nm_reallykillgame {} {
- # mute and flush audio
- /sys/servers/audio.flushaudio 0 0
-
- # Kill artefacts
- delete_possessicon
- delete_artefacts
- delete_ebar
- delete_helpscreen
-
- # Quit game; delete all world objects
- /world.killgame
-
- if {[/world.ispaused]} {
- /world.contgame
- }
-
- # Load singleplayer collision table (false => Singleplayer)
- setup_colltable false
-
- # Reset viewer
- /world.setviewer2 "/world/viewers/chaseviewer"
-
- # Show main menu
- nm_mainmenu
- /sys/servers/menuhandler.reset
- /sys/servers/menuhandler.hideallbars
- }
-
- #-------------------------------------------------------------------------------
- # Join multiplayer session
- #-------------------------------------------------------------------------------
- proc nm_sessionlist_multiplayer {} {
-
- # Get list of open session
- /sys/servers/menuhandler.showinfoscreen looking
- set num [/sys/servers/comm.asksessions 0 0]
- /sys/servers/menuhandler.hideinfoscreen
-
- if {$num == 0} {
- puts "No open sessions available."
- /sys/servers/menuhandler.openmenu nosessions
- } else {
- /sys/servers/menuhandler.openmenu sessionlist_multiplayer
- }
- }
-
- #-------------------------------------------------------------------------------
- # Join multiplayer session
- #-------------------------------------------------------------------------------
- proc nm_joinsession_multiplayer {session} {
- global home
-
- # Show loading screen.
- /sys/servers/menuhandler.showinfoscreen loading
- puts "*** Joining session $session. \n"
-
- # Joining session
- if {[/world.joinsession $session] == "false"} {
- puts "Joining session $session failed. "
- # Hide loading screen.
- /sys/servers/menuhandler.hideinfoscreen
-
- # Failed, go back to multiplayer menu
- /world.killgame
- # /sys/servers/menuhandler.cancelmenu
-
- /sys/servers/menuhandler.openmenu nosessions
- return
- }
-
- # Load client side win/loose handling script
- source $home/scripts/client.tcl
-
- # Setup multiplayer collision table (true => Multiplayer).
- setup_colltable true
-
- # Create character
- m_createcharacter
-
- # Load default event handling.
- source $home/book/defaultevents.tcl
-
- # Activate fast possess.
- /world.activatefastpossess
-
- # Hide loading screen.
- /sys/servers/menuhandler.hideinfoscreen
-
- # Choose viewer
- /world.setviewer2 "/world/viewers/chaseviewer"
-
- # Show `Waiting for other players' menu
- # /world.pausegame
- /sys/servers/menuhandler.openmenu "multiplayer_waitclient"
- /sys/servers/menuhandler.reset
- }
-
- #-------------------------------------------------------------------------------
- # Start session.
- #-------------------------------------------------------------------------------
- proc nm_startsession {} {
- /world.startsession
- /world.activatefastpossess
- }
-
- #-------------------------------------------------------------------------------
- #
- # Main Menu
- #
- #-------------------------------------------------------------------------------
- sel /world/gui
-
- new nroot menus
- sel menus
-
- new nguistandardmenu main
- sel main
- .settitle main
- .settitlerect -0.5 0.5 0.96 0.55
- .setabortable false
-
- # Entries
- new nroot entries
- sel entries
-
- if {!$demoFlag} {
- set y0 0.5
- set y1 0.2
- } else {
- set y0 0.3
- set y1 0.0
- }
-
- # Singleplayer
- new nguistandardmenuentry singleplayer
- sel singleplayer
- .setrect -0.4 0.4 $y0 $y1
- .setcommand "/sys/servers/menuhandler.openmenu singleplayer"
- sel ..
-
- set y0 $y1
- set y1 [expr ($y1 - 0.3)]
-
- if {!$demoFlag} {
- # Multiplayer
- new nguistandardmenuentry multiplayer
- sel multiplayer
- .setrect -0.4 0.4 $y0 $y1
- .setcommand "/sys/servers/menuhandler.openmenu multiplayer"
- sel ..
-
- set y0 $y1
- set y1 [expr ($y1 - 0.3)]
- }
-
- # Options
- new nguistandardmenuentry options
- sel options
- .setrect -0.4 0.4 $y0 $y1
- .setcommand "nm_options"
- sel ..
-
- set y0 $y1
- set y1 [expr ($y1 - 0.3)]
-
- # Quit game
- new nguistandardmenuentry leavegame
- sel leavegame
- .setrect -0.4 0.4 $y0 $y1
- .setcommand "/sys/servers/menuhandler.openmenu really_exit"
- sel ..
-
- set y0 $y1
- set y1 [expr ($y1 - 0.3)]
-
- # Credits
- if {!$demoFlag} {
- new nguistandardmenuentry credits
- sel credits
- .setrect -0.4 0.4 $y0 $y1
- .setcommand "nm_credits"
- sel ..
- }
-
- if {$devstation && (!$demoFlag)} {
- # Run test book
- new nguistandardmenuentry debug
- sel debug
- .setrect 0.7 1.0 -0.6 -0.9
- .setcommand "/sys/servers/menuhandler.closemenu; m_testbook"
- sel ..
- }
- sel ..
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Single player
- #-------------------------------------------------------------------------------
- new nguistandardmenu singleplayer
- sel singleplayer
-
- new nroot entries
- sel entries
-
- new nguistandardmenuentry newgame
- sel newgame
- .setrect -0.4 0.4 0.45 0.15
- .setcommand "nm_character_single"
- sel ..
-
- new nguistandardmenuentry loadgame
- sel loadgame
- .setrect -0.4 0.4 0.15 -0.15
- .setcommand "nm_open_loadgame_single"
- sel ..
-
- new nguistandardmenuentry cancel
- sel cancel
- .setrect -0.4 0.4 -0.15 -0.45
- .setcommand "/sys/servers/menuhandler.cancelmenu"
- sel ..
- sel ..
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Multi player
- #-------------------------------------------------------------------------------
- new nguistandardmenu multiplayer
- sel multiplayer
-
- new nroot entries
- sel entries
-
- new nguistandardmenuentry sharesession
- sel sharesession
- .setrect -0.4 0.4 0.45 0.15
- .setcommand "nm_load_character_server"
- sel ..
-
- new nguistandardmenuentry joinsession
- sel joinsession
- .setrect -0.4 0.4 0.15 -0.15
- .setcommand "nm_load_character_client"
- sel ..
-
- new nguistandardmenuentry cancel
- sel cancel
- .setrect -0.4 0.4 -0.15 -0.45
- .setcommand "/sys/servers/menuhandler.cancelmenu"
- sel ..
- sel ..
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Options
- #-------------------------------------------------------------------------------
- new nguistandardmenu options
- sel options
- .settitle options
-
- # Entries
- new nroot entries
- sel entries
-
- set b_left -0.95
- set b_right -0.25
-
- # resolution
- new nguistandardmenuentry resolution
- sel resolution
- .setrect $b_left $b_right 0.6 0.35
-
- # Submenu
- new nguistandardmenu submenu
- sel submenu
- .setmouseoverselect false
-
- # Entries
- new nroot entries
- sel entries
-
- # Low
- new nguistandardmenuentry 640_480
- sel 640_480
- .setrect -0.2 0.2 0.6 0.35
- .setcommand "/world.setpref resolution 0"
- sel ..
-
- # Medium
- new nguistandardmenuentry 800_600
- sel 800_600
- .setrect 0.2 0.6 0.6 0.35
- .setcommand "/world.setpref resolution 1"
- sel ..
-
- # High
- new nguistandardmenuentry 1024_768
- sel 1024_768
- .setrect 0.6 1.0 0.6 0.35
- .setcommand "/world.setpref resolution 2"
- sel ..
- sel ..
- sel ..
- sel ..
-
- # details
- new nguistandardmenuentry details
- sel details
- .setrect $b_left $b_right 0.35 0.1
-
- # Submenu
- new nguistandardmenu submenu
- sel submenu
- .setmouseoverselect false
-
- # Entries
- new nroot entries
- sel entries
-
- # Low
- new nguistandardmenuentry low
- sel low
- .setrect -0.2 0.2 0.35 0.1
- .setcommand "/world.setpref details 0"
- sel ..
-
- # Medium
- new nguistandardmenuentry med
- sel med
- .setrect 0.2 0.6 0.35 0.1
- .setcommand "/world.setpref details 1"
- sel ..
-
- # High
- new nguistandardmenuentry high
- sel high
- .setrect 0.6 1.0 0.35 0.1
- .setcommand "/world.setpref details 2"
- sel ..
- sel ..
- sel ..
- sel ..
-
- # invert mouse
- new nguistandardmenuentry invertmouse
- sel invertmouse
- .setrect $b_left $b_right 0.1 -0.15
-
- # Submenu
- new nguistandardmenu submenu
- sel submenu
- .setmouseoverselect false
-
- # Entries
- new nroot entries
- sel entries
-
- # Medium
- new nguistandardmenuentry yes
- sel yes
- .setrect -0.2 0.2 0.1 -0.15
- .setcommand "/world.setpref invertmouse 0"
- sel ..
-
- # High
- new nguistandardmenuentry no
- sel no
- .setrect 0.2 0.6 0.1 -0.15
- .setcommand "/world.setpref invertmouse 1"
- sel ..
- sel ..
- sel ..
- sel ..
-
- # volume
- new nguistandardmenuentry volume
- sel volume
- .setrect $b_left $b_right -0.15 -0.4
-
- # Submenu
- new nguistandardmenu submenu
- sel submenu
- .setmouseoverselect false
-
- # Entries
- new nroot entries
- sel entries
-
- set m_top -0.15
- set m_bot -0.35
- set m_left -0.15
- set m_width 0.14
-
- new nguistandardmenuentry 1
- sel 1
- .setrect $m_left [expr $m_left + 1*$m_width] $m_top $m_bot
- .setcommand "/world.setpref volume 0"
- sel ..
-
- new nguistandardmenuentry 2
- sel 2
- .setrect [expr $m_left + 1*$m_width] [expr $m_left + 2*$m_width] $m_top $m_bot
- .setcommand "/world.setpref volume 1"
- sel ..
-
- new nguistandardmenuentry 3
- sel 3
- .setrect [expr $m_left + 2*$m_width] [expr $m_left + 3*$m_width] $m_top $m_bot
- .setcommand "/world.setpref volume 2"
- sel ..
-
- new nguistandardmenuentry 4
- sel 4
- .setrect [expr $m_left + 3*$m_width] [expr $m_left + 4*$m_width] $m_top $m_bot
- .setcommand "/world.setpref volume 3"
- sel ..
-
- new nguistandardmenuentry 5
- sel 5
- .setrect [expr $m_left + 4*$m_width] [expr $m_left + 5*$m_width] $m_top $m_bot
- .setcommand "/world.setpref volume 4"
- sel ..
-
- sel ..
- sel ..
- sel ..
-
- # mouse sensitity
- new nguistandardmenuentry sensitivity
- sel sensitivity
- .setrect $b_left $b_right -0.4 -0.65
- # Submenu
- new nguistandardmenu submenu
- sel submenu
- .setmouseoverselect false
-
- # Entries
- new nroot entries
- sel entries
-
- set m_top -0.4
- set m_bot -0.6
- set m_left -0.15
- set m_width 0.14
-
- new nguistandardmenuentry 1
- sel 1
- .setrect $m_left [expr $m_left + 1*$m_width] $m_top $m_bot
- .setcommand "/world.setpref sensitivity 0"
- sel ..
-
- new nguistandardmenuentry 2
- sel 2
- .setrect [expr $m_left + 1*$m_width] [expr $m_left + 2*$m_width] $m_top $m_bot
- .setcommand "/world.setpref sensitivity 1"
- sel ..
-
- new nguistandardmenuentry 3
- sel 3
- .setrect [expr $m_left + 2*$m_width] [expr $m_left + 3*$m_width] $m_top $m_bot
- .setcommand "/world.setpref sensitivity 2"
- sel ..
-
- new nguistandardmenuentry 4
- sel 4
- .setrect [expr $m_left + 3*$m_width] [expr $m_left + 4*$m_width] $m_top $m_bot
- .setcommand "/world.setpref sensitivity 3"
- sel ..
-
- new nguistandardmenuentry 5
- sel 5
- .setrect [expr $m_left + 4*$m_width] [expr $m_left + 5*$m_width] $m_top $m_bot
- .setcommand "/world.setpref sensitivity 4"
- sel ..
-
- sel ..
- sel ..
- sel ..
-
-
- # accept
- new nguistandardmenuentry apply
- sel apply
- .setrect -0.8 -0.2 -0.7 -1.0
- .setcommand "/world.saveprefs; /world.applyprefs; /sys/servers/menuhandler.cancelmenu"
- sel ..
-
- # cancel
- new nguistandardmenuentry cancel
- sel cancel
- .setrect 0.2 0.8 -0.7 -1.0
- .setcommand "/world.loadprefs; /sys/servers/menuhandler.cancelmenu"
- sel ..
-
- sel ..
-
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Load game panel for single player mode
- #-------------------------------------------------------------------------------
- new nguiloadsavepanel loadgame_singleplayer
- sel loadgame_singleplayer
- .setdirectory "home:save/"
- .setmaxentries 20
- .setnumentriesx 5
- .setnumentriesy 4
- .setcommand "nm_loadgame_single"
- .settitle loadgame_singleplayer
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Save game panel
- #-------------------------------------------------------------------------------
- new nguiloadsavepanel savegame_singleplayer
- sel savegame_singleplayer
- .setdirectory "home:save/"
- .setmaxentries 20
- .setnumentriesx 5
- .setnumentriesy 4
- .setcommand "nm_savegame_single"
- .settitle savegame_singleplayer
- sel ..
-
- #-------------------------------------------------------------------------------
- # Procedure generates the character menu cursor and lighting.
- #-------------------------------------------------------------------------------
- proc nm_charactermenu_cursor {} {
-
- # Cursor
- new n3dnode cursor
- sel cursor
-
- new n3dnode gegenlicht
- sel gegenlicht
- ry 45
- rx -45
- new nlightnode light
- sel light
- .settype directional
- .setcolor 0 0.25 1 1
- sel ..
- sel ..
-
- # Glowing cursor
- new n3dnode glow
- sel glow
- .txyz 0 -0.9 0
-
- # Mesh
- new nmeshnode mesh
- sel mesh
- .setfilename "lib:glow2/plane.nvx"
- sel ..
-
- # Texture
- new ntexarraynode tex
- sel tex
- .settexture 0 "lib:glow2/texturenone.ntx" none
- sel ..
-
- # Shader
- new nlinknode shader
- sel shader
- .settarget "/data/shaders/additive_orange"
- sel ..
- sel ..
-
- new n3dnode gegenlicht
- sel gegenlicht
- ry 45
- rx -45
- new nlightnode light
- sel light
- .settype directional
- .setcolor 0 0.25 1 1
- sel ..
- sel ..
-
- # Light
- new n3dnode light
- sel light
- .txyz 0 1 0.5
- .setactive true
-
- new nlightnode light
- sel light
- .settype point
- .setcolor 0.5 0.3 0 1
- .setattenuation 0 0 0.5
- sel ..
- sel ..
- sel ..
- }
-
- #-------------------------------------------------------------------------------
- # Character selection
- #-------------------------------------------------------------------------------
- new nguistandardmenu character_singleplayer
- sel character_singleplayer
- .settitle character_singleplayer
-
- # cursor
- nm_charactermenu_cursor
-
- # entries
- new nroot entries
- sel entries
-
- # goliath
- new nguicharacterentry goliath
- sel goliath
- .setposition -0.8 0 -2.45
- .setorientation 0 220 0
- .setrect -1.0 -0.2 0.6 -1.0
- .setcommand "/sys/servers/menuhandler.closemenu; set character_proto char_goliath; m_newgame"
- new nguistandardmenuentry goliath
- sel goliath
- .setrect -0.6 -0.2 0.3 0.15
- sel ..
- sel ..
-
- # john
- new nguicharacterentry john
- sel john
- .setposition 0.2 0 -2.05
- .setorientation 0 180 0
- .setrect -0.2 0.3 0.6 -1.0
- .setcommand "/sys/servers/menuhandler.closemenu; set character_proto char_john; m_newgame"
- new nguistandardmenuentry john
- sel john
- .setrect -0.15 0.25 0.25 0.1
- sel ..
- sel ..
-
- # susie
- new nguicharacterentry susie
- sel susie
- .setposition 1.0 0 -2.2
- .setorientation 0 140 0
- .setrect 0.3 1.0 0.6 -1.0
- .setcommand "/sys/servers/menuhandler.closemenu; set character_proto char_susie; m_newgame"
- new nguistandardmenuentry susie
- sel susie
- .setrect 0.3 0.7 0.2 0.05
- sel ..
- sel ..
- sel ..
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Ingame singleplayer
- #-------------------------------------------------------------------------------
- new nguistandardmenu ingame_singleplayer
- sel ingame_singleplayer
-
- new nroot entries
- sel entries
-
- set m_left -0.36
- set m_right 0.36
- set m_top 0.78
- set m_height 0.27
-
- set m_oben $m_top
- set m_unten [expr $m_oben - $m_height]
-
- new nguistandardmenuentry continue
- sel continue
- .setrect $m_left $m_right $m_oben $m_unten
- .setcommand "nm_continue_game"
- sel ..
-
- set m_oben [expr $m_oben - $m_height]
- set m_unten [expr $m_unten - $m_height]
-
- new nguistandardmenuentry savegame
- sel savegame
- .setrect $m_left $m_right $m_oben $m_unten
- .setcommand "nm_open_savegame_single"
- sel ..
-
- set m_oben [expr $m_oben - $m_height]
- set m_unten [expr $m_unten - $m_height]
-
- new nguistandardmenuentry loadgame
- sel loadgame
- .setrect $m_left $m_right $m_oben $m_unten
- .setcommand "nm_open_loadgame_single"
- sel ..
-
- set m_oben [expr $m_oben - $m_height]
- set m_unten [expr $m_unten - $m_height]
-
- new nguistandardmenuentry restart
- sel restart
- .setrect $m_left $m_right $m_oben $m_unten
- .setcommand "nm_restartlevel"
- sel ..
-
- set m_oben [expr $m_oben - $m_height]
- set m_unten [expr $m_unten - $m_height]
-
- new nguistandardmenuentry options
- sel options
- .setrect $m_left $m_right $m_oben $m_unten
- .setcommand "nm_options"
- sel ..
-
- set m_oben [expr $m_oben - $m_height]
- set m_unten [expr $m_unten - $m_height]
-
- new nguistandardmenuentry killgame
- sel killgame
- .setrect $m_left $m_right $m_oben $m_unten
- .setcommand "nm_killgame ingame_singleplayer"
- sel ..
- sel ..
- sel ..
-
- #-------------------------------------------------------------------------------
- # Ingame Endgame Menu
- #
- # Shown when the player dies.
- #-------------------------------------------------------------------------------
- new nguistandardmenu ingame_endgame
- sel ingame_endgame
- .settitle you_loose
- .setabortable false
-
- new nroot entries
- sel entries
- new nguistandardmenuentry restart
- sel restart
- .setrect -0.4 0.4 0.45 0.15
- .setcommand "nm_restartlevel"
- sel ..
-
- new nguistandardmenuentry loadgame
- sel loadgame
- .setrect -0.4 0.4 0.15 -0.15
- .setcommand "nm_open_loadgame_single"
- sel ..
-
- new nguistandardmenuentry killgame
- sel killgame
- .setrect -0.4 0.4 -0.15 -0.45
- .setcommand "/sys/servers/menuhandler.openmenu ingame_confirm"
- sel ..
- sel ..
- sel ..
-
- #-------------------------------------------------------------------------------
- # Ingame Endgame Confirm
- #-------------------------------------------------------------------------------
- new nguistandardmenu ingame_confirm
- sel ingame_confirm
- .settitlerect -0.4 0.4 0.3 0.0
- .settitle ingame_confirm
- .setabortable false
-
- new nroot entries
- sel entries
- new nguistandardmenuentry no
- sel no
- .setrect -0.8 0.0 0.0 -0.3
- .setcommand "nm_ingame_endgame"
- sel ..
- new nguistandardmenuentry yes
- sel yes
- .setrect 0.0 0.8 0.0 -0.3
- .setcommand "nm_reallykillgame"
- sel ..
- sel ..
- sel ..
-
- #-------------------------------------------------------------------------------
- # Do you really want to exit?
- #-------------------------------------------------------------------------------
- new nguistandardmenu really_exit
- sel really_exit
- .settitlerect -0.4 0.4 0.3 0.0
- .settitle really_exit
- .setabortable true
- new nroot entries
- sel entries
- new nguistandardmenuentry no
- sel no
- .setrect -0.8 0.0 0.0 -0.3
- .setcommand "/sys/servers/menuhandler.openmenu main"
- sel ..
- new nguistandardmenuentry yes
- sel yes
- .setrect 0.0 0.8 0.0 -0.3
- .setcommand "/world.stopgame"
- sel ..
- sel ..
- sel ..
-
- #-------------------------------------------------------------------------------
- # Thanks for playing menu
- #-------------------------------------------------------------------------------
- new nguistandardmenu thxforplaying
- sel thxforplaying
- .settitle thxforplaying
- .setbackground locale:if_win.bmp
- .setcancelselects true
-
- new nroot entries
- sel entries
- new nguistandardmenuentry continue
- sel continue
- .setrect 0.2 1.0 -0.7 -1.0
- .setcommand "nm_mainmenu"
- sel ..
- sel ..
- sel ..
-
- #-------------------------------------------------------------------------------
- # Do you really want to abort?
- #-------------------------------------------------------------------------------
- new nguistandardmenu really_abort
- sel really_abort
- .settitlerect -0.4 0.4 0.3 0.0
- .settitle really_abort
- .setabortable true
- new nroot entries
- sel entries
- new nguistandardmenuentry no
- sel no
- .setrect -0.8 0.0 0.0 -0.3
- .setcommand "nm_goback"
- sel ..
- new nguistandardmenuentry yes
- sel yes
- .setrect 0.0 0.8 0.0 -0.3
- .setcommand "nm_reallykillgame"
- sel ..
- sel ..
- sel ..
- #-------------------------------------------------------------------------------
- # Ingame multiplayer
- #-------------------------------------------------------------------------------
- new nguistandardmenu ingame_multiplayer
- sel ingame_multiplayer
-
- new nroot entries
- sel entries
-
- # Continue
- new nguistandardmenuentry continue
- sel continue
- .setrect -0.4 0.4 0.45 0.15
- .setcommand "nm_continue_game"
- sel ..
-
- # Options
- new nguistandardmenuentry options
- sel options
- .setrect -0.4 0.4 0.15 -0.15
- .setcommand "nm_options"
- sel ..
-
- # Quit game
- new nguistandardmenuentry killgame
- sel killgame
- .setrect -0.4 0.4 -0.15 -0.45
- .setcommand "nm_killgame ingame_multiplayer"
- sel ..
- sel ..
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Multiplayer character selection (Server)
- #-------------------------------------------------------------------------------
- new nguistandardmenu character_server
- sel character_server
- .settitle character_server
-
- # cursor
- nm_charactermenu_cursor
-
- # entries
- new nroot entries
- sel entries
-
- # goliath
- new nguicharacterentry goliath
- sel goliath
- .setposition -0.8 0 -2.45
- .setorientation 0 220 0
- .setrect -1.0 -0.2 0.6 -1.0
- .setcommand "nm_character_server goliath"
- new nguistandardmenuentry goliath
- sel goliath
- .setrect -0.6 -0.2 0.3 0.15
- sel ..
- sel ..
-
- # john
- new nguicharacterentry john
- sel john
- .setposition 0.2 0 -2.05
- .setorientation 0 180 0
- .setrect -0.2 0.3 0.6 -1.0
- .setcommand "nm_character_server john"
- new nguistandardmenuentry john
- sel john
- .setrect -0.15 0.25 0.25 0.1
- sel ..
- sel ..
-
- # susie
- new nguicharacterentry susie
- sel susie
- .setposition 1.0 0 -2.2
- .setorientation 0 140 0
- .setrect 0.3 1.0 0.6 -1.0
- .setcommand "nm_character_server susie"
- new nguistandardmenuentry susie
- sel susie
- .setrect 0.3 0.7 0.2 0.05
- sel ..
- sel ..
- sel ..
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Multiplayer character selection (Client)
- #-------------------------------------------------------------------------------
- new nguistandardmenu character_client
- sel character_client
- .settitle character_client
-
- # cursor
- nm_charactermenu_cursor
-
- # entries
- new nroot entries
- sel entries
-
- # goliath
- new nguicharacterentry goliath
- sel goliath
- .setposition -0.8 0 -2.45
- .setorientation 0 220 0
- .setrect -1.0 -0.2 0.6 -1.0
- .setcommand "nm_character_client goliath"
- new nguistandardmenuentry goliath
- sel goliath
- .setrect -0.6 -0.2 0.3 0.15
- sel ..
- sel ..
-
- # john
- new nguicharacterentry john
- sel john
- .setposition 0.2 0 -2.05
- .setorientation 0 180 0
- .setrect -0.2 0.3 0.6 -1.0
- .setcommand "nm_character_client john"
- new nguistandardmenuentry john
- sel john
- .setrect -0.15 0.25 0.25 0.1
- sel ..
- sel ..
-
- # susie
- new nguicharacterentry susie
- sel susie
- .setposition 1.0 0 -2.2
- .setorientation 0 140 0
- .setrect 0.3 1.0 0.6 -1.0
- .setcommand "nm_character_client susie"
- new nguistandardmenuentry susie
- sel susie
- .setrect 0.3 0.7 0.2 0.05
- sel ..
- sel ..
- sel ..
- sel ..
-
- #-------------------------------------------------------------------------------
- # Load game panel for multi player mode
- #-------------------------------------------------------------------------------
- new nguiloadsavepanel loadgame_multiplayer
- sel loadgame_multiplayer
- .setdirectory "home:mplevels/"
- .setmaxentries 15
- .setnumentriesx 5
- .setnumentriesy 4
- .setcommand "nm_loadgame_multi"
- .settitle loadgame_multiplayer
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Multiplayer session list
- #-------------------------------------------------------------------------------
- new nguisessionspanel sessionlist_multiplayer
- sel sessionlist_multiplayer
- .setnumentriesx 5
- .setnumentriesy 4
- .setcommand "nm_joinsession_multiplayer"
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Multiplayer loose game menu
- #-------------------------------------------------------------------------------
- new nguistandardmenu multiplayer_loose
- sel multiplayer_loose
- .settitle multiplayer_loose
- .setabortable false
-
- # Entries
- new nroot entries
- sel entries
-
- # Exit
- new nguistandardmenuentry killgame
- sel killgame
- .setrect -0.4 0.4 0.15 -0.15
- .setcommand "nm_killgame multiplayer_loose"
- sel ..
- sel ..
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Multiplayer win game menu
- #-------------------------------------------------------------------------------
- new nguistandardmenu multiplayer_win
- sel multiplayer_win
- .settitle multiplayer_win
- .setabortable false
-
- # Entries
- new nroot entries
- sel entries
-
- # Exit
- new nguistandardmenuentry killgame
- sel killgame
- .setrect -0.4 0.4 0.15 -0.15
- .setcommand "nm_killgame multiplayer_win"
- sel ..
- sel ..
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Multiplayer wait for start game menu
- #-------------------------------------------------------------------------------
- new nguistandardmenu multiplayer_waitclient
- sel multiplayer_waitclient
- .settitle multiplayer_waitclient
- .setabortable false
-
- # Entries
- new nroot entries
- sel entries
-
- # Exit
- new nguistandardmenuentry killgame
- sel killgame
- .setrect -0.4 0.4 0.15 -0.15
- .setcommand "nm_killgame multiplayer_waitclient"
- sel ..
- sel ..
- sel ..
-
- #-------------------------------------------------------------------------------
- # Multiplayer start game menu
- #-------------------------------------------------------------------------------
- new nguistandardmenu multiplayer_waithost
- sel multiplayer_waithost
- .settitle multiplayer_waithost
- .setabortable false
-
- # Entries
- new nroot entries
- sel entries
-
- # Start
- new nguistandardmenuentry start
- sel start
- .setrect -0.4 0.4 0.3 0.0
- .setcommand "nm_startsession"
- sel ..
-
- # Exit
- new nguistandardmenuentry killgame
- sel killgame
- .setrect -0.4 0.4 0. -0.3
- .setcommand "nm_killgame multiplayer_waithost"
- sel ..
- sel ..
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Multiplayer connection lost
- #-------------------------------------------------------------------------------
- new nguistandardmenu connection_lost
- sel connection_lost
- .settitle connection_lost
- .setabortable false
-
- # Entries
- new nroot entries
- sel entries
-
- # Exit
- new nguistandardmenuentry killgame
- sel killgame
- .setrect -0.4 0.4 0.15 -0.15
- .setcommand "nm_reallykillgame"
- sel ..
- sel ..
- sel ..
-
- #-------------------------------------------------------------------------------
- # Multiplayer "no sessions found" menu
- #-------------------------------------------------------------------------------
- new nguistandardmenu nosessions
- sel nosessions
- .settitle nosessions
-
- # Entries
- new nroot entries
- sel entries
-
- # Try again
- new nguistandardmenuentry tryagain
- sel tryagain
- .setrect -0.4 0.4 0.3 0.0
- .setcommand "nm_sessionlist_multiplayer"
- sel ..
-
- # Exit
- new nguistandardmenuentry killgame
- sel killgame
- .setrect -0.4 0.4 0.0 -0.3
- .setcommand "nm_reallykillgame"
- sel ..
-
- sel ..
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Maennel/Clan/Distance bars
- #-------------------------------------------------------------------------------
- sel /world/gui
- new nroot bars
- sel bars
-
- #-------------------------------------------------------------------------------
- # Life bar (Default visual is for JOHN, but will be modified in CODE!!!)
- #-------------------------------------------------------------------------------
- new nguibar life
- sel life
- .setvisual "/data/if_ebar/ebar/leben_char_john/content"
- .setleftvisual "/data/if_ebar/ebar/leben_char_john/life_bar/left"
- .setmiddlevisual "/data/if_ebar/ebar/leben_char_john/life_bar/middle"
- .setrightvisual "/data/if_ebar/ebar/leben_char_john/life_bar/right"
-
- .setbasemax 20
- .setmax 50
- .setextension 10
-
- .setpos -1.7 1.25 -2
- .setleftpos -1.7 1.25 -2
- .setmiddlepos -1.1 1.25 -2
- .setmiddleoffset 0.2 0 0
- .setrightpos -1.14 1.25 -2
- sel ..
-
- #-------------------------------------------------------------------------------
- # Life bar for flak
- #-------------------------------------------------------------------------------
- new nguibar flak
- sel flak
- .setvisual "/data/if_ebar/ebar/flak/content"
- .setleftvisual "/data/if_ebar/ebar/flak/life_bar/left"
- .setmiddlevisual "/data/if_ebar/ebar/flak/life_bar/middle"
- .setrightvisual "/data/if_ebar/ebar/flak/life_bar/right"
-
- .setbasemax 20
- .setmax 20
- .setextension 10
-
- .setpos -1.7 1.25 -2
- .setleftpos -1.7 1.25 -2
- .setmiddlepos -1.1 1.25 -2
- .setmiddleoffset 0.2 0 0
- .setrightpos -1.14 1.25 -2
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Life bar for vehicle
- #-------------------------------------------------------------------------------
- new nguibar vehicle
- sel vehicle
- .setvisual "/data/if_ebar/ebar/vhcl/content"
- .setleftvisual "/data/if_ebar/ebar/vhcl/life_bar/left"
- .setmiddlevisual "/data/if_ebar/ebar/vhcl/life_bar/middle"
- .setrightvisual "/data/if_ebar/ebar/vhcl/life_bar/right"
-
- .setbasemax 20
- .setmax 20
- .setextension 10
-
- .setpos -1.7 1.25 -2
- .setleftpos -1.7 1.25 -2
- .setmiddlepos -1.1 1.25 -2
- .setmiddleoffset 0.2 0 0
- .setrightpos -1.14 1.25 -2
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Clan energy bar
- #-------------------------------------------------------------------------------
- new nguibar clan_energy
- sel clan_energy
-
- .setvisual "/data/if_ebar/ebar/kraft/content"
- .setleftvisual "/data/if_ebar/ebar/kraft/energy_bar/left"
- .setmiddlevisual "/data/if_ebar/ebar/kraft/energy_bar/middle"
- .setrightvisual "/data/if_ebar/ebar/kraft/energy_bar/right"
-
- .setbasemax 25
- .setmax 35
- .setextension 5
-
- .setpos -1.77 -1.4 -2.0
- .setleftpos -1.9 -1.2 -2.0
- .setmiddlepos -1.9 -0.9 -2.0
- .setmiddleoffset 0.0 0.1 0.0
- .setrightpos -1.9 -0.92 -2.0
- sel ..
-
-
- #-------------------------------------------------------------------------------
- # Bar for vertical distance to island.
- #-------------------------------------------------------------------------------
- new nguibar vertical_distance
- sel vertical_distance
- .setvisual "/data/if_ebar/distancebar/verti"
- .setpos 1.4 -0.92 -2.0
- sel ..
-
- #-------------------------------------------------------------------------------
- # Bar for horizontal distance to island.
- #-------------------------------------------------------------------------------
- new nguibar horizontal_distance
- sel horizontal_distance
- .setvisual "/data/if_ebar/distancebar/hori"
- .setpos 1.4 -0.92 -2.0
- sel ..
-
- #-------------------------------------------------------------------------------
- # Eventhandler-procs fuer Menuesounds
- #-------------------------------------------------------------------------------
- on __menuselect {
- # plop
- playfeedbacksound book:feedback/menueover.wav
- }
-
- # FLOH auskommentiert, wegen Ladepausen-Sound-Artefakte
- # (neue Menues haben eine Verzoegerung drin, weil die Bitmaps
- # geladen werden muessen, deshalb gibt es Audio-Artefakte)
- on __menuaction {
- # pling
- # playfeedbacksound book:feedback/use_ok.wav
- }
-
- # FLOH auskommentiert, wegen Ladepausen-Sound-Artefakte
- # (neue Menues haben eine Verzoegerung drin, weil die Bitmaps
- # geladen werden muessen, deshalb gibt es Audio-Artefakte)
- on __menuclose {
- # wusch
- # playfeedbacksound book:feedback/taken_control.wav
- }
-
- #-------------------------------------------------------------------------------
- # Start with main menu
- #-------------------------------------------------------------------------------
- /sys/servers/menuhandler.reset
- #/sys/servers/menuhandler.openmenu "main"
- /sys/servers/menuhandler.showcredits "/data/if_intro/welcome" 10
-